/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaz;

import Clases.Ciclo;
import Clases.Grado;
import Clases.Gradoseccionciclo;
import Clases.Seccion;
import Controladores.*;
import escuela.conexion;
import escuela.exceptions.IllegalOrphanException;
import escuela.exceptions.NonexistentEntityException;
import java.awt.Component;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SpinnerNumberModel;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author xamU
 */
public class bIngresoGradoCicloSeccion extends javax.swing.JDialog {

    /**
     * Creates new form bIngresoGradoCicloSeccion
     */
    public bIngresoGradoCicloSeccion(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        editarCiclo.setVisible(false);
        eliminarCiclo.setVisible(false);
        editarGrado.setVisible(false);
        eliminarGrado.setVisible(false);
        editarSeccion.setVisible(false);
        eliminarSeccion.setVisible(false);
        editarClase.setVisible(false);
        eliminarClase.setVisible(false);
        //Apartado de todas las pestañas para mostrar/ocultar
        Component panelEditarGrado=jTabbedPane2.getComponent(2);
        Component panelEditarCiclo=jTabbedPane3.getComponent(2);
        Component panelEliminarGrado=jTabbedPane2.getComponent(3);
        Component panelEliminarCiclo=jTabbedPane3.getComponent(3);
        Component panelEditarSeccion=jTabbedPane4.getComponent(2);
        Component panelEliminarSeccion=jTabbedPane4.getComponent(3);
        Component panelEditarClase=jTabbedPane5.getComponent(2);
        Component panelEliminarClase=jTabbedPane5.getComponent(3);
        this.setEditarPanelGrado(panelEditarGrado);
        this.setEliminarPanelGrado(panelEliminarGrado);
        this.setEditarPanelCiclo(panelEditarCiclo);
        this.setEliminarPanelCiclo(panelEliminarCiclo);
        this.setEditarPanelSeccion(panelEditarSeccion);
        this.setEliminarPanelSeccion(panelEliminarSeccion);
        this.setEditarPanelClase(panelEditarClase);
        this.setEliminarPanelClase(panelEliminarClase);
        jTabbedPane2.removeTabAt(2);
        jTabbedPane2.removeTabAt(2);
        jTabbedPane3.removeTabAt(2);
        jTabbedPane3.removeTabAt(2);
        jTabbedPane4.removeTabAt(2);
        jTabbedPane4.removeTabAt(2);
        jTabbedPane5.removeTabAt(2);
        jTabbedPane5.removeTabAt(2);
        
        //Límite negativo a los Spinners
        SpinnerNumberModel nuevo= new SpinnerNumberModel();
        nuevo.setMinimum(0);
        jSpinner2.setModel(nuevo);
        jSpinner1.setModel(nuevo);
        this.cargarTablaGrados();
        this.cargarTablaCiclos();
        this.cargarTablaSecciones();
        this.cargarTablaClases();
        this.llenarComboCiclos();
        this.llenarComboGrados();
        this.llenarComboSecciones();
              
        
        
    }
    
    Component tPanelEditarGrado=null,tPanelEliminarGrado=null,tPanelEditarCiclo=null,tPanelEliminarCiclo=null,tPanelEditarSeccion=null,tPanelEliminarSeccion=null,tPanelEditarClase=null,tPanelEliminarClase=null;
    ArrayList lista=new ArrayList();
    /**
     *
     * @param valor se ingresa un valor tipo componente
     */
    public void setEditarPanelGrado(Component valor)
    {
        this.tPanelEditarGrado=valor;
    }
    /**
     *
     * @return nada, ya que sólo llena una variable
     */
    public Component getEditarPanelGrado()
        {
            return this.tPanelEditarGrado;
        }
    /**
     *
     * @param valor variable que almacena un Componente
     */
    public void setEliminarPanelGrado(Component valor)
    {
        this.tPanelEliminarGrado=valor;
    }
    /**
     *
     * @return nada, ya que sólo llena una variable
     */
    public Component getEliminarPanelGrado()
        {
            return this.tPanelEliminarGrado;
        }
    /**
     *
     * @param valor Almacena una variable tipo Componente para el Panel Ciclo
     */
    public void setEditarPanelCiclo(Component valor)
    {
        this.tPanelEditarCiclo=valor;
    }
    /**
     *
     * @return nada, ya que sólo llena una variable
     */
    public Component getEditarPanelCiclo()
        {
            return this.tPanelEditarCiclo;
        }
    /**
     *
     * @param valor Almacena una variable tipo Componente para el panel Ciclo
     */
    public void setEliminarPanelCiclo(Component valor)
    {
        this.tPanelEliminarCiclo=valor;
    }
    /**
     *
     * @return nada, ya que sólo llena una variable
     */
    public Component getEliminarPanelCiclo()
        {
            return this.tPanelEliminarCiclo;
        }
    /**
     *
     * @param valor Almacena una variable tipo Componente para el panel Seccion
     */
    public void setEliminarPanelSeccion(Component valor)
    {
        this.tPanelEliminarSeccion=valor;
    }
     /**
      *
      * @return nada, ya que sólo llena una variable
      */
     public Component getEliminarPanelSeccion()
        {
            return this.tPanelEliminarSeccion;
        }
     /**
      *
      * @param valor Almacena una variable tipo Componente para el panel Seccion
      */
     public void setEditarPanelSeccion(Component valor)
    {
        this.tPanelEditarSeccion=valor;
    }
     /**
      *
      * @return nada, ya que sólo llena una variable
      */
     public Component getEditarPanelSeccion()
        {
            return this.tPanelEditarSeccion;
        }
     /**
      *
      * @param valor Almacena una variable tipo Componente para el panel Clase
      */
     public void setEditarPanelClase(Component valor)
    {
        this.tPanelEditarClase=valor;
    }
     /**
      *
      * @return nada, ya que sólo llena una variable
      */
     public Component getEditarPanelClase()
        {
            return this.tPanelEditarClase;
        }
    /**
     *
     * @param valor Almacena una variable tipo Componente para el panel Clase
     */
    public void setEliminarPanelClase(Component valor)
    {
        this.tPanelEliminarClase=valor;
    }
    /**
     *
     * @return nada, ya que sólo llena una variable
     */
    public Component getEliminarPanelClase()
        {
            return this.tPanelEliminarClase;
        }
    
    
    /**
     *
     */
    public void cargarTablaGrados()
    {
        Object[] datos= new Object[2];
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("idGrado");
        modelo.addColumn("Nombre Grado");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
        List<Grado> grados = grado.findGradoEntities();
            for(Grado i: grados)
            {
                datos[0]=i.getIdGrado();
                datos[1]=i.getNombre();
                modelo.addRow(datos);
            }
        this.jTable1.setModel(modelo);
    }   
    
    /**
     *
     */
    public void cargarTablaCiclos()
    {
        Object[] datos= new Object[4];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idCiclo");
        modelo.addColumn("Año del Ciclo");
        modelo.addColumn("Nota de Aprobación");
        modelo.addColumn("Número de Unidades");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        CicloJpaController ciclo=new CicloJpaController(emf);//modificar el constructor del CicloJpaController
        List<Ciclo> ciclos = ciclo.findCicloEntities();
            for(Ciclo i: ciclos)
            {
                datos[0]=i.getIdCiclo();
                datos[1]=i.getAño();
                datos[2]=i.getNotaAprobacion();
                datos[3]=i.getNumeroUnidades();
                modelo.addRow(datos);
            }
       this.jTable2.setModel(modelo);
    }
    
    /**
     *
     */
    public void cargarTablaSecciones()
    {
        Object[] datos= new Object[2];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idSección");
        modelo.addColumn("Sección");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        SeccionJpaController seccion=new SeccionJpaController(emf);//modificar el constructor del GradoJpaController
        List<Seccion> secciones = seccion.findSeccionEntities();
            for(Seccion i: secciones)
            {
                datos[0]=i.getIdSeccion();
                datos[1]=i.getNombre();
                modelo.addRow(datos);
            }
        this.jTable3.setModel(modelo);
    }
    
    public void cargarTablaClases()
    {
        Object[] datos= new Object[6];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idClase");
        modelo.addColumn("Capacidad de Clase");
        modelo.addColumn("Aula");
        modelo.addColumn("idGrado");
        modelo.addColumn("idCiclo");
        modelo.addColumn("idSección");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);//modificar el constructor del GradoJpaController
        List<Gradoseccionciclo> gscs = gsc.findGradoseccioncicloEntities();
            for(Gradoseccionciclo i: gscs)
            {
                datos[0]=i.getIdGradoSeccionCiclo();
                datos[1]=i.getCapacidad();
                datos[2]=i.getAula();
                datos[3]=i.getGrado().getIdGrado();
                datos[4]=i.getCiclo().getIdCiclo();
                datos[5]=i.getSeccion().getIdSeccion();
                modelo.addRow(datos);
            }
        this.jTable4.setModel(modelo);
    }
    
    /**
     *
     * @param texto Almacena una variable tipo String para realizar consultas de busqueda de Grados
     */
    public void cargarFiltroGrados(String texto)
    {
        Object[] datos= new Object[2];
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("idGrado");
        modelo.addColumn("Nombre Grado");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoPersonalizada grado=new GradoPersonalizada(emf);//modificar el constructor del GradoJpaController
        List<Grado> grados = grado.buscarPorinicial(texto);
            for(Grado i: grados)
            {
                datos[0]=i.getIdGrado();
                datos[1]=i.getNombre();
                modelo.addRow(datos);
            }
        this.jTable1.setModel(modelo);
    }
    
    /**
     *
     * @param texto Almacena una variable tipo String para realizar consultas de busqueda de Ciclo
     */
    public void cargarFiltroCiclos(String texto)
    {
        Object[] datos= new Object[4];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idCiclo");
        modelo.addColumn("Año del Ciclo");
        modelo.addColumn("Nota de Aprobación");
        modelo.addColumn("Número de Unidades");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        CicloPersonalizada ciclo=new CicloPersonalizada(emf);//modificar el constructor del CicloJpaController
        List<Ciclo> ciclos = ciclo.buscarPorinicial(texto);
            for(Ciclo i: ciclos)
            {
                datos[0]=i.getIdCiclo();
                datos[1]=i.getAño();
                datos[2]=i.getNotaAprobacion();
                datos[3]=i.getNumeroUnidades();
                modelo.addRow(datos);
            }
       this.jTable2.setModel(modelo);
    }
    
    /**
     *
     * @param texto Almacena una variable tipo String para realizar consultas de busqueda de Seccion
     */
    public void cargarFiltroSecciones(String texto)
    {
        Object[] datos= new Object[2];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idSección");
        modelo.addColumn("Sección");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        SeccionPersonalizada seccion=new SeccionPersonalizada(emf);//modificar el constructor del GradoJpaController
        List<Seccion> secciones = seccion.buscarPorinicial(texto);
            for(Seccion i: secciones)
            {
                datos[0]=i.getIdSeccion();
                datos[1]=i.getNombre();
                modelo.addRow(datos);
            }
        this.jTable3.setModel(modelo);
    }
    
    /**
     *
     * @param texto Almacena una variable tipo String para realizar consultas de busqueda de Clases
     */
    public void cargarFiltroClases(String texto)
    {
        Object[] datos= new Object[6];
        DefaultTableModel modelo = new DefaultTableModel(); 
        modelo.addColumn("idClase");
        modelo.addColumn("Capacidad de Clase");
        modelo.addColumn("Aula");
        modelo.addColumn("idGrado");
        modelo.addColumn("idCiclo");
        modelo.addColumn("idSección");
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoseccioncicloPersonalizada gsc=new GradoseccioncicloPersonalizada(emf);//modificar el constructor del GradoJpaController
        List<Gradoseccionciclo> gscs = gsc.buscarPorinicial(texto);
            for(Gradoseccionciclo i: gscs)
            {
                datos[0]=i.getIdGradoSeccionCiclo();
                datos[1]=i.getCapacidad();
                datos[2]=i.getAula();
                datos[3]=i.getGrado().getIdGrado();
                datos[4]=i.getCiclo().getIdCiclo();
                datos[5]=i.getSeccion().getIdSeccion();
                modelo.addRow(datos);
            }
        this.jTable4.setModel(modelo);
    }
    //Funciones para llenar los combobox con los id en la pestaña de Clases
    /**
     *  Función para llenar los combobox del formulario Clases con IDGrado
     */
    public void llenarComboGrados()
    {
            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            GradoJpaController grado=new GradoJpaController(emf);
            List<Grado> grados = grado.findGradoEntities();
            int temp=0;
            for(Grado h: grados)
            {
                   if(!this.existe(grado.findGrado(h.getIdGrado()).getIdGrado(), comboIdGrado))
                         comboIdGrado.addItem(grado.findGrado(h.getIdGrado()).getIdGrado());
                    temp++;
            }
    }
    /**
     * Función para llenar los combobox del formulario Clases con IDCiclo
     */
    public void llenarComboCiclos()
    {
            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            CicloJpaController ciclo=new CicloJpaController(emf);
            List<Ciclo> ciclos = ciclo.findCicloEntities();
            int temp=0;
            for(Ciclo h: ciclos)
            {
                if(!this.existe(ciclo.findCiclo(h.getIdCiclo()).getIdCiclo(), comboIdCiclo))
                         comboIdCiclo.addItem(ciclo.findCiclo(h.getIdCiclo()).getIdCiclo());
                temp++;
            }
    }
    /**
     * Función para llenar los combobox del formulario Clases con IDSeccion
     */
    public void llenarComboSecciones()
    {
            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            SeccionJpaController seccion=new SeccionJpaController(emf);
            List<Seccion> secciones = seccion.findSeccionEntities();
            int temp=0;
            for(Seccion h: secciones)
            {   
               if(!this.existe(seccion.findSeccion(h.getIdSeccion()).getIdSeccion(), comboIdSeccion))
                    comboIdSeccion.addItem(seccion.findSeccion(h.getIdSeccion()).getIdSeccion());
                temp++;
            }
    }
    
    /**
     *
     * @param valor Almacena un valor tipo Short
     * @param temp Almacena un JCombobox para evaluar
     * @return una variable tipo boolean, true si existe, false si no.
     */
    public boolean existe(Short valor,JComboBox temp)
    {
        for(int i=0;i<temp.getItemCount();i++)
        {
            if(valor==Short.valueOf(temp.getItemAt(i).toString()))
              return true;
        }
        return false;
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        editarGrado = new javax.swing.JButton();
        eliminarGrado = new javax.swing.JButton();
        filtroGrado = new javax.swing.JTextField();
        jLabel39 = new javax.swing.JLabel();
        buscarGrado = new javax.swing.JButton();
        verGrado = new javax.swing.JButton();
        jLabel74 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        nombreGradoIngresado = new javax.swing.JTextField();
        aceptarGradoCreado = new javax.swing.JButton();
        cancelarGradoCreado = new javax.swing.JButton();
        jLabel36 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        cancelarEditarGrado = new javax.swing.JButton();
        aceptarEditarGrado = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        eliminarGradoAceptar = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        editarCiclo = new javax.swing.JButton();
        eliminarCiclo = new javax.swing.JButton();
        jLabel41 = new javax.swing.JLabel();
        filtroCiclo = new javax.swing.JTextField();
        buscarCiclo = new javax.swing.JButton();
        verCiclos = new javax.swing.JButton();
        jLabel75 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        añoCicloCreado = new javax.swing.JTextField();
        aceptarCicloCreado = new javax.swing.JButton();
        cancelarCicloCreado = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        notaAprobacionCicloCreado = new javax.swing.JTextField();
        jSpinner1 = new javax.swing.JSpinner();
        jLabel37 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        cancelarEditarCiclo = new javax.swing.JButton();
        aceptarEditarCiclo = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jSpinner2 = new javax.swing.JSpinner();
        jPanel11 = new javax.swing.JPanel();
        aceptarEliminarCiclo = new javax.swing.JButton();
        cancelarEliminarCiclo = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jTabbedPane4 = new javax.swing.JTabbedPane();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        editarSeccion = new javax.swing.JButton();
        eliminarSeccion = new javax.swing.JButton();
        jLabel40 = new javax.swing.JLabel();
        filtroSeccion = new javax.swing.JTextField();
        buscarSeccion = new javax.swing.JButton();
        verSecciones = new javax.swing.JButton();
        jLabel76 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        aceptarCrearSeccion = new javax.swing.JButton();
        cancelarCrearSeccion = new javax.swing.JButton();
        jLabel38 = new javax.swing.JLabel();
        jPanel14 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jButton21 = new javax.swing.JButton();
        jButton22 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jButton23 = new javax.swing.JButton();
        jButton24 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jTabbedPane5 = new javax.swing.JTabbedPane();
        jPanel17 = new javax.swing.JPanel();
        jLabel42 = new javax.swing.JLabel();
        filtroClase = new javax.swing.JTextField();
        buscarClase = new javax.swing.JButton();
        verClases = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable4 = new javax.swing.JTable();
        editarClase = new javax.swing.JButton();
        eliminarClase = new javax.swing.JButton();
        jLabel77 = new javax.swing.JLabel();
        jPanel18 = new javax.swing.JPanel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        aulaClase = new javax.swing.JTextField();
        jSpinner3 = new javax.swing.JSpinner();
        jLabel46 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        comboIdGrado = new javax.swing.JComboBox();
        jLabel48 = new javax.swing.JLabel();
        comboIdCiclo = new javax.swing.JComboBox();
        jLabel49 = new javax.swing.JLabel();
        comboIdSeccion = new javax.swing.JComboBox();
        cancelarClaseCreada = new javax.swing.JButton();
        aceptarClaseCreada = new javax.swing.JButton();
        jPanel19 = new javax.swing.JPanel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        jSpinner4 = new javax.swing.JSpinner();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        aulaClaseEditar = new javax.swing.JTextField();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        cancelarClaseCreada1 = new javax.swing.JButton();
        aceptarClaseCreada1 = new javax.swing.JButton();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        jPanel20 = new javax.swing.JPanel();
        jLabel60 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jLabel64 = new javax.swing.JLabel();
        jLabel65 = new javax.swing.JLabel();
        jLabel66 = new javax.swing.JLabel();
        jLabel67 = new javax.swing.JLabel();
        jLabel68 = new javax.swing.JLabel();
        jLabel69 = new javax.swing.JLabel();
        cancelarClaseCreada2 = new javax.swing.JButton();
        aceptarClaseEliminada = new javax.swing.JButton();
        jLabel70 = new javax.swing.JLabel();
        jLabel71 = new javax.swing.JLabel();
        jTaskPane1 = new com.l2fprod.common.swing.JTaskPane();
        jLabel72 = new javax.swing.JLabel();
        jLabel73 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Administracion de Clases");

        jTabbedPane2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane2MouseClicked(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "idGrado", "Nombre del Grado"
            }
        ));
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        editarGrado.setText("Editar");
        editarGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                editarGradoMouseClicked(evt);
            }
        });

        eliminarGrado.setText("Eliminar");
        eliminarGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                eliminarGradoMouseClicked(evt);
            }
        });

        jLabel39.setText("Filtro:");

        buscarGrado.setText("Buscar");
        buscarGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buscarGradoMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                buscarGradoMouseEntered(evt);
            }
        });

        verGrado.setText("Ver Todo");
        verGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                verGradoMouseClicked(evt);
            }
        });
        verGrado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verGradoActionPerformed(evt);
            }
        });

        jLabel74.setText("<Para editar o eliminar alguno de los campos de las tablas, hacer un clic sobre él>");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel74)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel8Layout.createSequentialGroup()
                            .addGap(15, 15, 15)
                            .addComponent(jLabel39)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(filtroGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(buscarGrado)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(verGrado))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(eliminarGrado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(editarGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(filtroGrado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel39)
                    .addComponent(buscarGrado)
                    .addComponent(verGrado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel74)
                .addGap(6, 6, 6))
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(editarGrado)
                .addGap(18, 18, 18)
                .addComponent(eliminarGrado)
                .addContainerGap(184, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Ver Grados", jPanel8);

        jLabel1.setText("ID Grado:");

        jLabel2.setText("Nombre del Grado:");

        aceptarGradoCreado.setText("Aceptar");
        aceptarGradoCreado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarGradoCreadoMouseClicked(evt);
            }
        });
        aceptarGradoCreado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarGradoCreadoActionPerformed(evt);
            }
        });

        cancelarGradoCreado.setText("Cancelar");
        cancelarGradoCreado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarGradoCreadoMouseClicked(evt);
            }
        });

        jLabel36.setText("<ID del Grado Autoasignado>");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nombreGradoIngresado, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel36))
                        .addGap(0, 98, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addContainerGap(415, Short.MAX_VALUE)
                        .addComponent(cancelarGradoCreado)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarGradoCreado)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel36))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(nombreGradoIngresado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 156, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarGradoCreado)
                    .addComponent(cancelarGradoCreado))
                .addContainerGap())
        );

        jTabbedPane2.addTab("Crear Grado", jPanel5);

        jLabel3.setText("ID Grado:");

        jLabel4.setText("Nombre del Grado:");

        jLabel5.setText("<ID del Grado Seleccinado>");

        jTextField3.setText("<Nombre Grado Seleccionado>");

        cancelarEditarGrado.setText("Cancelar");
        cancelarEditarGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarEditarGradoMouseClicked(evt);
            }
        });

        aceptarEditarGrado.setText("Aceptar");
        aceptarEditarGrado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarEditarGradoMouseClicked(evt);
            }
        });
        aceptarEditarGrado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                aceptarEditarGradoKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addContainerGap(415, Short.MAX_VALUE)
                        .addComponent(cancelarEditarGrado)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarEditarGrado))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4))
                        .addGap(56, 56, 56)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 158, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel5))
                .addGap(18, 18, 18)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 159, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarEditarGrado)
                    .addComponent(cancelarEditarGrado))
                .addContainerGap())
        );

        jTabbedPane2.addTab("Editar Grado", jPanel6);

        jLabel6.setText("ID Grado:");

        jLabel7.setText("<ID del Grado Seleccinado>");

        jLabel8.setText("Nombre del Grado:");

        jLabel9.setText("<Nombre del Grado Seleccinado>");

        eliminarGradoAceptar.setText("Aceptar");
        eliminarGradoAceptar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                eliminarGradoAceptarMouseClicked(evt);
            }
        });

        jButton9.setText("Cancelar");
        jButton9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton9MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel8))
                        .addGap(56, 56, 56)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel9))
                        .addGap(0, 234, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addContainerGap(415, Short.MAX_VALUE)
                        .addComponent(jButton9)
                        .addGap(18, 18, 18)
                        .addComponent(eliminarGradoAceptar)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7))
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 162, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(eliminarGradoAceptar)
                    .addComponent(jButton9))
                .addContainerGap())
        );

        jTabbedPane2.addTab("Eliminar Grado", jPanel7);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 594, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Grado", jPanel2);

        jTabbedPane3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane3MouseClicked(evt);
            }
        });

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "idCiclo", "Año", "Nota de Aprobación", "Número de Unidades"
            }
        ));
        jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable2MouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jTable2);

        editarCiclo.setText("Editar");
        editarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                editarCicloMouseClicked(evt);
            }
        });

        eliminarCiclo.setText("Eliminar");
        eliminarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                eliminarCicloMouseClicked(evt);
            }
        });

        jLabel41.setText("Filtro:");

        buscarCiclo.setText("Buscar");
        buscarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buscarCicloMouseClicked(evt);
            }
        });

        verCiclos.setText("Ver Todo");
        verCiclos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                verCiclosMouseClicked(evt);
            }
        });

        jLabel75.setText("<Para editar o eliminar alguno de los campos de las tablas, hacer un clic sobre él>");

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(jLabel41)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(filtroCiclo, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(buscarCiclo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(verCiclos))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel75)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(eliminarCiclo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(editarCiclo, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap(12, Short.MAX_VALUE)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(filtroCiclo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel41)
                    .addComponent(buscarCiclo)
                    .addComponent(verCiclos))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel75)
                .addGap(5, 5, 5))
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(editarCiclo)
                .addGap(18, 18, 18)
                .addComponent(eliminarCiclo)
                .addContainerGap(188, Short.MAX_VALUE))
        );

        jTabbedPane3.addTab("Ver Ciclos", jPanel12);

        jLabel10.setText("ID Ciclo:");

        jLabel11.setText("Año:");

        aceptarCicloCreado.setText("Aceptar");
        aceptarCicloCreado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarCicloCreadoMouseClicked(evt);
            }
        });
        aceptarCicloCreado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarCicloCreadoActionPerformed(evt);
            }
        });

        cancelarCicloCreado.setText("Cancelar");
        cancelarCicloCreado.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarCicloCreadoMouseClicked(evt);
            }
        });

        jLabel19.setText("Nota de Aprobación:");

        jLabel20.setText("Número de Unidades:");

        jLabel37.setText("<ID del Ciclo Autoasignado>");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(jLabel11)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel37)
                            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(notaAprobacionCicloCreado, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE)
                                .addComponent(añoCicloCreado, javax.swing.GroupLayout.Alignment.LEADING)))
                        .addGap(0, 277, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarCicloCreado)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarCicloCreado)))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jLabel37))
                .addGap(18, 18, 18)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(añoCicloCreado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(notaAprobacionCicloCreado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 78, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarCicloCreado)
                    .addComponent(cancelarCicloCreado))
                .addContainerGap())
        );

        jTabbedPane3.addTab("Crear Ciclo", jPanel9);

        jLabel12.setText("ID Ciclo:");

        jLabel13.setText("Año:");

        jLabel14.setText("<ID del Ciclo Seleccinado>");

        jTextField6.setText("<Año del Ciclo Seleccionado>");

        cancelarEditarCiclo.setText("Cancelar");
        cancelarEditarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarEditarCicloMouseClicked(evt);
            }
        });

        aceptarEditarCiclo.setText("Aceptar");
        aceptarEditarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarEditarCicloMouseClicked(evt);
            }
        });

        jLabel21.setText("Nota de Aprobación:");

        jLabel22.setText("Número de Unidades:");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addComponent(jLabel22)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                                .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 46, Short.MAX_VALUE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarEditarCiclo)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarEditarCiclo)))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel14))
                .addGap(18, 18, 18)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarEditarCiclo)
                    .addComponent(cancelarEditarCiclo))
                .addContainerGap())
        );

        jTabbedPane3.addTab("Editar Ciclo", jPanel10);

        aceptarEliminarCiclo.setText("Aceptar");
        aceptarEliminarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarEliminarCicloMouseClicked(evt);
            }
        });

        cancelarEliminarCiclo.setText("Cancelar");
        cancelarEliminarCiclo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarEliminarCicloMouseClicked(evt);
            }
        });

        jLabel15.setText("ID Ciclo:");

        jLabel16.setText("Año:");

        jLabel23.setText("Nota de Aprobación:");

        jLabel24.setText("Número de Unidades:");

        jLabel17.setText("<ID del Ciclo Seleccinado>");

        jLabel18.setText("<Año del Ciclo Seleccinado>");

        jLabel25.setText("<Nota de Aprobación del Ciclo Seleccinado>");

        jLabel26.setText("<Número de Unidades del Ciclo Seleccinado>");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarEliminarCiclo)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarEliminarCiclo))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel24)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel16)
                                    .addComponent(jLabel23)
                                    .addComponent(jLabel15))
                                .addGap(41, 41, 41)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel17)
                                    .addComponent(jLabel25)
                                    .addComponent(jLabel18)
                                    .addComponent(jLabel26))))
                        .addGap(0, 178, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel17))
                .addGap(18, 18, 18)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jLabel18))
                .addGap(18, 18, 18)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jLabel25))
                .addGap(20, 20, 20)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(jLabel26))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarEliminarCiclo)
                    .addComponent(cancelarEliminarCiclo))
                .addContainerGap())
        );

        jTabbedPane3.addTab("Eliminar Ciclo", jPanel11);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane3)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Ciclo", jPanel3);

        jTabbedPane4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPane4MouseClicked(evt);
            }
        });

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "idSección", "Nombre de Sección"
            }
        ));
        jTable3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable3MouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTable3);

        editarSeccion.setText("Editar");
        editarSeccion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                editarSeccionMouseClicked(evt);
            }
        });

        eliminarSeccion.setText("Eliminar");
        eliminarSeccion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                eliminarSeccionMouseClicked(evt);
            }
        });

        jLabel40.setText("Filtro:");

        buscarSeccion.setText("Buscar");
        buscarSeccion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buscarSeccionMouseClicked(evt);
            }
        });

        verSecciones.setText("Ver Todo");
        verSecciones.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                verSeccionesMouseClicked(evt);
            }
        });

        jLabel76.setText("<Para editar o eliminar alguno de los campos de las tablas, hacer un clic sobre él>");

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel76)
                    .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel16Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel16Layout.createSequentialGroup()
                            .addGap(21, 21, 21)
                            .addComponent(jLabel40)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(filtroSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(buscarSeccion)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(verSecciones))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(eliminarSeccion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(editarSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(filtroSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel40)
                    .addComponent(buscarSeccion)
                    .addComponent(verSecciones))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel76)
                .addGap(12, 12, 12))
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(editarSeccion)
                .addGap(18, 18, 18)
                .addComponent(eliminarSeccion)
                .addContainerGap(195, Short.MAX_VALUE))
        );

        jTabbedPane4.addTab("Ver Secciones", jPanel16);

        jLabel27.setText("ID Sección:");

        jLabel28.setText("Nombre de Sección:");

        aceptarCrearSeccion.setText("Aceptar");
        aceptarCrearSeccion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarCrearSeccionMouseClicked(evt);
            }
        });

        cancelarCrearSeccion.setText("Cancelar");
        cancelarCrearSeccion.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarCrearSeccionMouseClicked(evt);
            }
        });

        jLabel38.setText("<ID de la Sección Autoasignado>");

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addComponent(jLabel28))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel38))
                        .addGap(0, 92, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarCrearSeccion)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarCrearSeccion)))
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jLabel38))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 156, Short.MAX_VALUE)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarCrearSeccion)
                    .addComponent(cancelarCrearSeccion))
                .addContainerGap())
        );

        jTabbedPane4.addTab("Crear Sección", jPanel13);

        jLabel29.setText("ID Sección:");

        jLabel30.setText("Nombre de Sección:");

        jLabel31.setText("<ID de Sección Seleccinada>");

        jTextField11.setText("<Nombre Sección Seleccionada>");

        jButton21.setText("Cancelar");
        jButton21.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton21MouseClicked(evt);
            }
        });

        jButton22.setText("Aceptar");
        jButton22.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton22MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel29)
                            .addComponent(jLabel30))
                        .addGap(56, 56, 56)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel31)
                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 152, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(jButton21)
                        .addGap(18, 18, 18)
                        .addComponent(jButton22)))
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(jLabel31))
                .addGap(18, 18, 18)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 159, Short.MAX_VALUE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton22)
                    .addComponent(jButton21))
                .addContainerGap())
        );

        jTabbedPane4.addTab("Editar Sección", jPanel14);

        jLabel32.setText("ID Sección:");

        jLabel33.setText("<ID del Sección Seleccinada>");

        jLabel34.setText("Nombre de Sección:");

        jLabel35.setText("<Nombre de Sección Seleccinada>");

        jButton23.setText("Aceptar");
        jButton23.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton23MouseClicked(evt);
            }
        });

        jButton24.setText("Cancelar");
        jButton24.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton24MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel34))
                        .addGap(56, 56, 56)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel33)
                            .addComponent(jLabel35))
                        .addGap(0, 223, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(jButton24)
                        .addGap(18, 18, 18)
                        .addComponent(jButton23)))
                .addContainerGap())
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel32)
                    .addComponent(jLabel33))
                .addGap(18, 18, 18)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel34)
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 162, Short.MAX_VALUE)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton23)
                    .addComponent(jButton24))
                .addContainerGap())
        );

        jTabbedPane4.addTab("Eliminar Sección", jPanel15);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane4)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Sección", jPanel4);

        jTabbedPane5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jTabbedPane5MousePressed(evt);
            }
        });

        jLabel42.setText("Filtro:");

        buscarClase.setText("Buscar");
        buscarClase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buscarClaseMouseClicked(evt);
            }
        });

        verClases.setText("Ver Todo");
        verClases.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                verClasesMouseClicked(evt);
            }
        });

        jTable4.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "idGrado", "Nombre del Grado"
            }
        ));
        jTable4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable4MouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(jTable4);

        editarClase.setText("Editar");
        editarClase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                editarClaseMouseClicked(evt);
            }
        });

        eliminarClase.setText("Eliminar");
        eliminarClase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                eliminarClaseMouseClicked(evt);
            }
        });

        jLabel77.setText("<Para editar o eliminar alguno de los campos de las tablas, hacer un clic sobre él>");

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel77)
                    .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel17Layout.createSequentialGroup()
                            .addGap(15, 15, 15)
                            .addComponent(jLabel42)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(filtroClase, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(buscarClase)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(verClases))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(eliminarClase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(editarClase, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel17Layout.createSequentialGroup()
                .addContainerGap(15, Short.MAX_VALUE)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(filtroClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel42)
                    .addComponent(buscarClase)
                    .addComponent(verClases))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel77)
                .addGap(4, 4, 4))
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(editarClase)
                .addGap(18, 18, 18)
                .addComponent(eliminarClase)
                .addContainerGap(187, Short.MAX_VALUE))
        );

        jTabbedPane5.addTab("Ver Clases", jPanel17);

        jLabel43.setText("ID Clase:");

        jLabel44.setText("<ID de la Clase Autoasignado>");

        jLabel45.setText("Capacidad de Clase:");

        jLabel46.setText("Aula:");

        jLabel47.setText("ID Grado:");

        comboIdGrado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0" }));

        jLabel48.setText("ID Ciclo:");

        comboIdCiclo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0" }));

        jLabel49.setText("ID Sección:");

        comboIdSeccion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0" }));

        cancelarClaseCreada.setText("Cancelar");
        cancelarClaseCreada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarClaseCreadaMouseClicked(evt);
            }
        });

        aceptarClaseCreada.setText("Aceptar");
        aceptarClaseCreada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarClaseCreadaMouseClicked(evt);
            }
        });
        aceptarClaseCreada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarClaseCreadaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel18Layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel43)
                            .addComponent(jLabel45)
                            .addComponent(jLabel46)
                            .addComponent(jLabel47)
                            .addComponent(jLabel49))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(comboIdSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel44)
                            .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel18Layout.createSequentialGroup()
                                    .addComponent(comboIdGrado, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel48)
                                    .addGap(56, 56, 56)
                                    .addComponent(comboIdCiclo, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(aulaClase, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 83, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarClaseCreada)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarClaseCreada)))
                .addContainerGap())
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel43)
                    .addComponent(jLabel44))
                .addGap(18, 18, 18)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel45)
                    .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aulaClase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel46))
                .addGap(25, 25, 25)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel47)
                    .addComponent(comboIdGrado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel48)
                    .addComponent(comboIdCiclo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel49)
                    .addComponent(comboIdSeccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarClaseCreada)
                    .addComponent(cancelarClaseCreada))
                .addContainerGap())
        );

        jTabbedPane5.addTab("Crear Clase", jPanel18);

        jLabel50.setText("ID Clase:");

        jLabel51.setText("<ID de la Clase Autoasignado>");

        jLabel52.setText("Capacidad de Clase:");

        jLabel53.setText("Aula:");

        jLabel54.setText("ID Grado:");

        jLabel55.setText("ID Ciclo:");

        jLabel56.setText("ID Sección:");

        cancelarClaseCreada1.setText("Cancelar");
        cancelarClaseCreada1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarClaseCreada1MouseClicked(evt);
            }
        });

        aceptarClaseCreada1.setText("Aceptar");
        aceptarClaseCreada1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarClaseCreada1MouseClicked(evt);
            }
        });
        aceptarClaseCreada1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarClaseCreada1ActionPerformed(evt);
            }
        });

        jLabel57.setText("<ID de la Clase Autoasignado>");

        jLabel58.setText("<ID de la Clase Autoasignado>");

        jLabel59.setText("<ID de la Clase Autoasignado>");

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addGap(35, 35, 35)
                        .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel19Layout.createSequentialGroup()
                                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel19Layout.createSequentialGroup()
                                        .addComponent(jLabel52)
                                        .addGap(32, 32, 32)
                                        .addComponent(jSpinner4, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel19Layout.createSequentialGroup()
                                        .addComponent(jLabel54)
                                        .addGap(35, 35, 35)
                                        .addComponent(jLabel57)))
                                .addGap(64, 64, 64)
                                .addComponent(jLabel55)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel59))
                            .addGroup(jPanel19Layout.createSequentialGroup()
                                .addComponent(jLabel56)
                                .addGap(28, 28, 28)
                                .addComponent(jLabel58))
                            .addGroup(jPanel19Layout.createSequentialGroup()
                                .addComponent(jLabel53)
                                .addGap(105, 105, 105)
                                .addComponent(aulaClaseEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel19Layout.createSequentialGroup()
                                .addComponent(jLabel50)
                                .addGap(86, 86, 86)
                                .addComponent(jLabel51)))
                        .addGap(0, 49, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                        .addContainerGap(414, Short.MAX_VALUE)
                        .addComponent(cancelarClaseCreada1)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarClaseCreada1)))
                .addContainerGap())
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel50)
                    .addComponent(jLabel51))
                .addGap(18, 18, 18)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel52)
                    .addComponent(jSpinner4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aulaClaseEditar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel53))
                .addGap(28, 28, 28)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel54)
                    .addComponent(jLabel55)
                    .addComponent(jLabel57)
                    .addComponent(jLabel59))
                .addGap(18, 18, 18)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel56)
                    .addComponent(jLabel58))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(aceptarClaseCreada1)
                    .addComponent(cancelarClaseCreada1))
                .addContainerGap())
        );

        jTabbedPane5.addTab("Editar Clase", jPanel19);

        jLabel60.setText("ID Clase:");

        jLabel61.setText("<ID de la Clase Autoasignado>");

        jLabel62.setText("Capacidad de Clase:");

        jLabel63.setText("Aula:");

        jLabel64.setText("ID Grado:");

        jLabel65.setText("<ID de la Clase Autoasignado>");

        jLabel66.setText("ID Ciclo:");

        jLabel67.setText("<ID de la Clase Autoasignado>");

        jLabel68.setText("<ID de la Clase Autoasignado>");

        jLabel69.setText("ID Sección:");

        cancelarClaseCreada2.setText("Cancelar");
        cancelarClaseCreada2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cancelarClaseCreada2MouseClicked(evt);
            }
        });

        aceptarClaseEliminada.setText("Aceptar");
        aceptarClaseEliminada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aceptarClaseEliminadaMouseClicked(evt);
            }
        });
        aceptarClaseEliminada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarClaseEliminadaActionPerformed(evt);
            }
        });

        jLabel70.setText("<ID de la Clase Autoasignado>");

        jLabel71.setText("<ID de la Clase Autoasignado>");

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addGap(152, 152, 152)
                        .addComponent(jLabel70))
                    .addGroup(jPanel20Layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(jLabel71)))
                .addContainerGap(285, Short.MAX_VALUE))
            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel20Layout.createSequentialGroup()
                    .addGap(22, 22, 22)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel20Layout.createSequentialGroup()
                            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel20Layout.createSequentialGroup()
                                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel62)
                                        .addGroup(jPanel20Layout.createSequentialGroup()
                                            .addComponent(jLabel64)
                                            .addGap(35, 35, 35)
                                            .addComponent(jLabel65)))
                                    .addGap(64, 64, 64)
                                    .addComponent(jLabel66)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel67))
                                .addGroup(jPanel20Layout.createSequentialGroup()
                                    .addComponent(jLabel69)
                                    .addGap(28, 28, 28)
                                    .addComponent(jLabel68))
                                .addComponent(jLabel63)
                                .addGroup(jPanel20Layout.createSequentialGroup()
                                    .addComponent(jLabel60)
                                    .addGap(86, 86, 86)
                                    .addComponent(jLabel61)))
                            .addGap(0, 49, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel20Layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 379, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cancelarClaseCreada2)
                            .addGap(18, 18, 18)
                            .addComponent(aceptarClaseEliminada)))
                    .addGap(23, 23, 23)))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGap(65, 65, 65)
                .addComponent(jLabel70)
                .addGap(18, 18, 18)
                .addComponent(jLabel71)
                .addContainerGap(165, Short.MAX_VALUE))
            .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel20Layout.createSequentialGroup()
                    .addGap(31, 31, 31)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel60)
                        .addComponent(jLabel61))
                    .addGap(18, 18, 18)
                    .addComponent(jLabel62)
                    .addGap(18, 18, 18)
                    .addComponent(jLabel63)
                    .addGap(28, 28, 28)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel64)
                        .addComponent(jLabel66)
                        .addComponent(jLabel65)
                        .addComponent(jLabel67))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel69)
                        .addComponent(jLabel68))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                    .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(aceptarClaseEliminada)
                        .addComponent(cancelarClaseCreada2))
                    .addGap(31, 31, 31)))
        );

        jTabbedPane5.addTab("Eliminar Clase", jPanel20);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 593, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane5)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Clase", jPanel1);

        jLabel72.setFont(new java.awt.Font("Arial", 1, 14));
        jLabel72.setForeground(new java.awt.Color(255, 255, 255));
        jLabel72.setText("Ingreso de Grados, Ciclos y Secciones -Asignación de Clases-");
        jTaskPane1.add(jLabel72);

        jLabel73.setFont(new java.awt.Font("Arial", 0, 12));
        jLabel73.setForeground(new java.awt.Color(255, 255, 255));
        jLabel73.setText("En este formulario se ingresan los datos relacionados con la creación de las Clases del Establecimiento");
        jTaskPane1.add(jLabel73);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTaskPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 618, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTaskPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    private void aceptarGradoCreadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarGradoCreadoMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoJpaController grado=new GradoJpaController(emf);
        try
        {
            Grado nuevoGrado= new Grado(null,nombreGradoIngresado.getText());
            grado.create(nuevoGrado);    
            JOptionPane.showMessageDialog(null, "El Grado ha sido creado Exitosamente", "Información", JOptionPane.INFORMATION_MESSAGE);   
            nombreGradoIngresado.setText("");                 
            this.cargarTablaGrados();

        }
        catch(Exception e)
                {
                 JOptionPane.showMessageDialog(null, "No se ha podido crear el Grado: "+e, "Error", JOptionPane.ERROR_MESSAGE);   
                }        
    }//GEN-LAST:event_aceptarGradoCreadoMouseClicked

    private void aceptarCicloCreadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarCicloCreadoMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        CicloJpaController ciclo=new CicloJpaController(emf);
         try
        {
            Ciclo nuevoCiclo= new Ciclo(null, (short) Integer.parseInt(añoCicloCreado.getText()),notaAprobacionCicloCreado.getText(),Short.valueOf(jSpinner1.getValue().toString()));
            ciclo.create(nuevoCiclo);
            JOptionPane.showMessageDialog(null, "El Ciclo ha sido creado Exitosamente", "Información", JOptionPane.INFORMATION_MESSAGE); 
            añoCicloCreado.setText("");
            notaAprobacionCicloCreado.setText("");
            SpinnerNumberModel nuevo= new SpinnerNumberModel();
            nuevo.setValue(0);
            jSpinner1.setModel(nuevo);
            this.cargarTablaCiclos();
            
        }
        catch(Exception e)
                {
                 JOptionPane.showMessageDialog(null, "No se ha podido crear el Ciclo: "+e, "Error", JOptionPane.ERROR_MESSAGE);   
                }
        
        
    }//GEN-LAST:event_aceptarCicloCreadoMouseClicked

    private void cancelarCicloCreadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarCicloCreadoMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            añoCicloCreado.setText("");
            notaAprobacionCicloCreado.setText("");
            SpinnerNumberModel nuevo= new SpinnerNumberModel();
            nuevo.setValue(0);
            jSpinner1.setModel(nuevo);
            jTabbedPane3.setSelectedIndex(0);
        }
        
    }//GEN-LAST:event_cancelarCicloCreadoMouseClicked

    private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
        // TODO add your handling code here:
        editarGrado.setVisible(true);
        eliminarGrado.setVisible(true);
    }//GEN-LAST:event_jTable1MouseClicked

    private void editarGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editarGradoMouseClicked
        // TODO add your handling code here:
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma editar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEditarPanelGrado();
            jTabbedPane2.add("Editar Grado",temp);
            Short idGrado=(Short) jTable1.getValueAt(jTable1.getSelectedRow(), 0);
            String nombreGrado=(String)jTable1.getValueAt(jTable1.getSelectedRow(), 1);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
            List<Grado> grados = grado.findGradoEntities();
                for(Grado i: grados)
                {
                    if(i.getIdGrado()==idGrado)
                    {
                        jTabbedPane2.setSelectedIndex(2);
                        jLabel5.setText(idGrado.toString());
                        jTextField3.setText(nombreGrado);
                        jTextField3.setFocusable(true);
                        editarGrado.setVisible(false);
                        eliminarGrado.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarGrado.setVisible(false);
            eliminarGrado.setVisible(false);
        }
        
        
    }//GEN-LAST:event_editarGradoMouseClicked

    private void aceptarEditarGradoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_aceptarEditarGradoKeyPressed

            // TODO add your handling code here:
        
           
    }//GEN-LAST:event_aceptarEditarGradoKeyPressed

    private void aceptarEditarGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarEditarGradoMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
        List<Grado> grados = grado.findGradoEntities();
            for(Grado i: grados)
            {
                if(i.getIdGrado()==Short.valueOf(jLabel5.getText().trim()))
                { 
                    try 
                    {
                        i.setIdGrado(Short.valueOf(jLabel5.getText().trim()));
                        i.setNombre(jTextField3.getText());
                        grado.edit(i);
                        JOptionPane.showMessageDialog(null,"El Grado ha sido correctamente editado","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane2.removeTabAt(2);
                        jTabbedPane2.setSelectedIndex(0);
                        this.cargarTablaGrados();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"El Grado no pudo ser editado: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_aceptarEditarGradoMouseClicked

    private void eliminarGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eliminarGradoMouseClicked
        // TODO add your handling code here:
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma ingresar a Eliminar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEliminarPanelGrado();
            jTabbedPane2.add("Eliminar Grado",temp);
            Short idGrado=(Short) jTable1.getValueAt(jTable1.getSelectedRow(), 0);
            String nombreGrado=(String)jTable1.getValueAt(jTable1.getSelectedRow(), 1);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
            List<Grado> grados = grado.findGradoEntities();
                for(Grado i: grados)
                {
                    if(i.getIdGrado()==idGrado)
                    {
                        jTabbedPane2.setSelectedIndex(2);
                        jLabel7.setText(idGrado.toString());
                        jLabel9.setText(nombreGrado);
                        editarGrado.setVisible(false);
                        eliminarGrado.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarGrado.setVisible(false);
            eliminarGrado.setVisible(false);
        }
        
        
    }//GEN-LAST:event_eliminarGradoMouseClicked

    private void eliminarGradoAceptarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eliminarGradoAceptarMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
        List<Grado> grados = grado.findGradoEntities();
            for(Grado i: grados)
            {
                if(i.getIdGrado()==Short.valueOf(jLabel7.getText().trim()))
                { 
                    try 
                    {
                        grado.destroy(Short.valueOf(jLabel7.getText().trim()));
                        JOptionPane.showMessageDialog(null,"El Grado ha sido correctamente Eliminado","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane2.removeTabAt(2);
                        jTabbedPane2.setSelectedIndex(0);
                        this.cargarTablaGrados();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"El Grado no pudo ser Eliminado: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_eliminarGradoAceptarMouseClicked

    private void jTable2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2MouseClicked
        // TODO add your handling code here:
        editarCiclo.setVisible(true);
        eliminarCiclo.setVisible(true);
    }//GEN-LAST:event_jTable2MouseClicked

    private void editarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editarCicloMouseClicked
        // TODO add your handling code here:
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma Editar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEditarPanelCiclo();
            jTabbedPane3.add("Editar Ciclo",temp);
            Short idCiclo=(Short) jTable2.getValueAt(jTable2.getSelectedRow(), 0);
            Short añoCiclo=(Short)jTable2.getValueAt(jTable2.getSelectedRow(), 1);
            String nAprobacion=(String)jTable2.getValueAt(jTable2.getSelectedRow(), 2);
            Short nUnidades=(Short)jTable2.getValueAt(jTable2.getSelectedRow(), 3);


            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            CicloJpaController ciclo=new CicloJpaController(emf);//modificar el constructor del GradoJpaController
            List<Ciclo> ciclos = ciclo.findCicloEntities();
                for(Ciclo i: ciclos)
                {
                    if(i.getIdCiclo()==idCiclo)
                    {
                        jTabbedPane3.setSelectedIndex(2);
                        jLabel4.setText(idCiclo.toString());
                        jTextField6.setText(añoCiclo.toString());
                        jTextField8.setText(nAprobacion);
                        SpinnerNumberModel nuevo= new SpinnerNumberModel();
                        nuevo.setValue(nUnidades);
                        jSpinner2.setModel(nuevo);
                        jTextField3.setFocusable(true);
                        editarCiclo.setVisible(false);
                        eliminarCiclo.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarCiclo.setVisible(false);
            eliminarCiclo.setVisible(false);
        }
        
        
    }//GEN-LAST:event_editarCicloMouseClicked

    private void eliminarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eliminarCicloMouseClicked
        // TODO add your handling code here:
        
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma ingresar a Eliminar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEliminarPanelCiclo();
            jTabbedPane3.add("Eliminar Ciclo",temp);
            editarCiclo.setVisible(false);
            eliminarCiclo.setVisible(false);
            Short idCiclo=(Short) jTable2.getValueAt(jTable2.getSelectedRow(), 0);
            Short añoCiclo=(Short)jTable2.getValueAt(jTable2.getSelectedRow(), 1);
            String nAprobacion=(String)jTable2.getValueAt(jTable2.getSelectedRow(), 2);
            Short nUnidades=(Short)jTable2.getValueAt(jTable2.getSelectedRow(), 3);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            CicloJpaController ciclo=new CicloJpaController(emf);//modificar el constructor del GradoJpaController
            List<Ciclo> ciclos = ciclo.findCicloEntities();
                for(Ciclo i: ciclos)
                {
                    if(i.getIdCiclo()==idCiclo)
                    {
                        jTabbedPane3.setSelectedIndex(2);
                        jLabel7.setText(idCiclo.toString());
                        jLabel18.setText(añoCiclo.toString());
                        jLabel25.setText(nAprobacion);
                        jLabel26.setText(nUnidades.toString());
                        editarCiclo.setVisible(false);
                        eliminarCiclo.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarCiclo.setVisible(false);
            eliminarCiclo.setVisible(false);
        }
        
    }//GEN-LAST:event_eliminarCicloMouseClicked

    private void aceptarEditarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarEditarCicloMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        CicloJpaController ciclo=new CicloJpaController(emf);//modificar el constructor del GradoJpaController
        List<Ciclo> ciclos = ciclo.findCicloEntities();
            for(Ciclo i: ciclos)
            {
                if(i.getIdCiclo()==Short.valueOf(jLabel4.getText().trim()))
                { 
                    try 
                    {
                        i.setIdCiclo(Short.valueOf(jLabel5.getText().trim()));
                        i.setAño((short) Integer.parseInt(jTextField6.getText()));
                        i.setNotaAprobacion(jTextField8.getText());
                        i.setNumeroUnidades(Short.valueOf(jSpinner2.getValue().toString()));
                        ciclo.edit(i);
                        JOptionPane.showMessageDialog(null,"El Ciclo ha sido correctamente editado","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane3.removeTabAt(2);
                        jTabbedPane3.setSelectedIndex(0);
                        this.cargarTablaCiclos();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"El Ciclo no pudo ser editado: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                       
                    } 
                    
                }
            }
        
    }//GEN-LAST:event_aceptarEditarCicloMouseClicked

    private void aceptarEliminarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarEliminarCicloMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        CicloJpaController ciclo=new CicloJpaController(emf);//modificar el constructor del GradoJpaController
        List<Ciclo> ciclos = ciclo.findCicloEntities();
            for(Ciclo i: ciclos)
            {
                if(i.getIdCiclo()==Short.valueOf(jLabel17.getText().trim()))
                { 
                    try 
                    {
                        ciclo.destroy(Short.valueOf(jLabel17.getText().trim()));
                        JOptionPane.showMessageDialog(null,"El Ciclo ha sido correctamente Eliminado","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane3.removeTabAt(2);
                        jTabbedPane3.setSelectedIndex(0);
                        this.cargarTablaCiclos();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"El Ciclo no pudo ser Eliminado: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_aceptarEliminarCicloMouseClicked

    private void cancelarEditarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarEditarCicloMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane3.removeTabAt(2);
            jTabbedPane3.setSelectedIndex(0);
        }
            
   
    }//GEN-LAST:event_cancelarEditarCicloMouseClicked

    private void cancelarEliminarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarEliminarCicloMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane3.removeTabAt(2);
            jTabbedPane3.setSelectedIndex(0);
        }
    }//GEN-LAST:event_cancelarEliminarCicloMouseClicked

    private void jButton9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton9MouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane2.removeTabAt(2);
            jTabbedPane2.setSelectedIndex(0);
        }
    }//GEN-LAST:event_jButton9MouseClicked

    private void cancelarGradoCreadoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarGradoCreadoMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            nombreGradoIngresado.setText("");
            jTabbedPane2.setSelectedIndex(0);
        }
    }//GEN-LAST:event_cancelarGradoCreadoMouseClicked

    private void aceptarCrearSeccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarCrearSeccionMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        SeccionJpaController seccion=new SeccionJpaController(emf);
        try
        {
            Seccion nuevaSeccion= new Seccion(null,jTextField10.getText());
            seccion.create(nuevaSeccion);    
            JOptionPane.showMessageDialog(null, "La Sección ha sido creado Exitosamente", "Información", JOptionPane.INFORMATION_MESSAGE);   
            jTextField10.setText("");
            this.cargarTablaSecciones();
        }
        catch(Exception e)
                {
                 JOptionPane.showMessageDialog(null, "No se ha podido crear la Sección: "+e, "Error", JOptionPane.ERROR_MESSAGE);   
                }
    }//GEN-LAST:event_aceptarCrearSeccionMouseClicked

    private void cancelarCrearSeccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarCrearSeccionMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTextField10.setText("");
            jTabbedPane4.setSelectedIndex(0);
        }
    }//GEN-LAST:event_cancelarCrearSeccionMouseClicked

    private void jButton22MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton22MouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        SeccionJpaController seccion=new SeccionJpaController(emf);
        List<Seccion> secciones = seccion.findSeccionEntities();
            for(Seccion i: secciones)
            {
                if(i.getIdSeccion()==Short.valueOf(jLabel31.getText().trim()))
                { 
                    try 
                    {
                        i.setIdSeccion(Short.valueOf(jLabel31.getText().trim()));
                        i.setNombre(jTextField11.getText());
                        seccion.edit(i);
                        JOptionPane.showMessageDialog(null,"La Sección ha sido correctamente editada","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane4.removeTabAt(2);
                        jTabbedPane4.setSelectedIndex(0);
                        this.cargarTablaSecciones();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"La Sección no pudo ser editada: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_jButton22MouseClicked

    private void cancelarEditarGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarEditarGradoMouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane2.removeTabAt(2);
            jTabbedPane2.setSelectedIndex(0);
        }
    }//GEN-LAST:event_cancelarEditarGradoMouseClicked

    private void jButton21MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton21MouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
            jTabbedPane4.removeTabAt(2);
    }//GEN-LAST:event_jButton21MouseClicked

    private void jButton24MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton24MouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane4.removeTabAt(2);
            jTabbedPane4.setSelectedIndex(0);
        }
    }//GEN-LAST:event_jButton24MouseClicked

    private void jButton23MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton23MouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        SeccionJpaController seccion=new SeccionJpaController(emf);
        List<Seccion> secciones = seccion.findSeccionEntities();
            for(Seccion i: secciones)
            {
                if(i.getIdSeccion()==Short.valueOf(jLabel35.getText().trim()))
                { 
                    try 
                    {
                        seccion.destroy(Short.valueOf(jLabel35.getText().trim()));
                        JOptionPane.showMessageDialog(null,"La Sección ha sido correctamente Eliminado","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane4.removeTabAt(2);
                        jTabbedPane4.setSelectedIndex(0);
                        this.cargarTablaSecciones();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"La Sección no pudo ser Eliminada: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_jButton23MouseClicked

    private void jTable3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable3MouseClicked
        // TODO add your handling code here:
        editarSeccion.setVisible(true);
        eliminarSeccion.setVisible(true);
    }//GEN-LAST:event_jTable3MouseClicked

    private void editarSeccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editarSeccionMouseClicked
        // TODO add your handling code here:
        
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma Editar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEditarPanelSeccion();
            jTabbedPane4.add("Editar Sección",temp);
            Short idSeccion=(Short) jTable3.getValueAt(jTable3.getSelectedRow(), 0);
            String nombreSeccion=(String)jTable3.getValueAt(jTable3.getSelectedRow(), 1);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            SeccionJpaController seccion=new SeccionJpaController(emf);
            List<Seccion> secciones = seccion.findSeccionEntities();
                for(Seccion i: secciones)
                {
                    if(i.getIdSeccion()==idSeccion)
                    {
                        jTabbedPane4.setSelectedIndex(2);
                        jLabel31.setText(idSeccion.toString());
                        jTextField11.setText(nombreSeccion);
                        jTextField11.setFocusable(true);
                        editarSeccion.setVisible(false);
                        eliminarSeccion.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarSeccion.setVisible(false);
            eliminarSeccion.setVisible(false);
        }
        
    }//GEN-LAST:event_editarSeccionMouseClicked

    private void eliminarSeccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eliminarSeccionMouseClicked
        // TODO add your handling code here:
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma Editar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEliminarPanelSeccion();
            jTabbedPane4.add("Eliminar Sección",temp);
            Short idSeccion=(Short) jTable3.getValueAt(jTable3.getSelectedRow(), 0);
            String nombreSeccion=(String)jTable3.getValueAt(jTable3.getSelectedRow(), 1);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            SeccionJpaController seccion=new SeccionJpaController(emf);
            List<Seccion> secciones = seccion.findSeccionEntities();
                for(Seccion i: secciones)
                {
                    if(i.getIdSeccion()==idSeccion)
                    {
                        jTabbedPane4.setSelectedIndex(2);
                        jLabel7.setText(idSeccion.toString());
                        jLabel9.setText(nombreSeccion);
                        editarSeccion.setVisible(false);
                        eliminarSeccion.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarSeccion.setVisible(false);
            eliminarSeccion.setVisible(false);
        }
        
    }//GEN-LAST:event_eliminarSeccionMouseClicked

    private void jTabbedPane3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane3MouseClicked
        // TODO add your handling code here:
        añoCicloCreado.setFocusable(true);
    }//GEN-LAST:event_jTabbedPane3MouseClicked

    private void jTabbedPane2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane2MouseClicked
        // TODO add your handling code here:
        nombreGradoIngresado.setFocusable(true);
    }//GEN-LAST:event_jTabbedPane2MouseClicked

    private void jTabbedPane4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane4MouseClicked
        // TODO add your handling code here:
        jTextField10.setFocusable(true);
    }//GEN-LAST:event_jTabbedPane4MouseClicked

    private void buscarGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buscarGradoMouseClicked
        // TODO add your handling code here:
        this.cargarFiltroGrados(filtroGrado.getText());
    }//GEN-LAST:event_buscarGradoMouseClicked

    private void verGradoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_verGradoMouseClicked
        // TODO add your handling code here:
        this.cargarTablaGrados();
        filtroGrado.setText("");
    }//GEN-LAST:event_verGradoMouseClicked

    private void buscarSeccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buscarSeccionMouseClicked
        // TODO add your handling code here:
        this.cargarFiltroSecciones(filtroSeccion.getText());
    }//GEN-LAST:event_buscarSeccionMouseClicked

    private void verSeccionesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_verSeccionesMouseClicked
        // TODO add your handling code here:
        this.cargarTablaSecciones();
        filtroSeccion.setText("");
    }//GEN-LAST:event_verSeccionesMouseClicked

    private void buscarCicloMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buscarCicloMouseClicked
        // TODO add your handling code here:
        this.cargarFiltroCiclos(filtroCiclo.getText());
    }//GEN-LAST:event_buscarCicloMouseClicked

    private void verCiclosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_verCiclosMouseClicked
        // TODO add your handling code here:
        this.cargarTablaCiclos();
        filtroCiclo.setText("");
    }//GEN-LAST:event_verCiclosMouseClicked

    private void aceptarGradoCreadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarGradoCreadoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aceptarGradoCreadoActionPerformed

    private void buscarClaseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buscarClaseMouseClicked
        // TODO add your handling code here:
        this.cargarFiltroClases(filtroClase.getText());
    }//GEN-LAST:event_buscarClaseMouseClicked

    private void verClasesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_verClasesMouseClicked
        // TODO add your handling code here:
        this.cargarTablaClases();
    }//GEN-LAST:event_verClasesMouseClicked

    private void jTable4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable4MouseClicked
        // TODO add your handling code here:
        editarClase.setVisible(true);
        eliminarClase.setVisible(true);
    }//GEN-LAST:event_jTable4MouseClicked

    private void editarClaseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editarClaseMouseClicked
        // TODO add your handling code here:
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma editar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
            Component temp=this.getEditarPanelClase();
            jTabbedPane5.add("Editar Clase",temp);
            Short idClase=(Short) jTable4.getValueAt(jTable4.getSelectedRow(), 0);
            Short capacidad=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 1);
            String aula=(String)jTable4.getValueAt(jTable4.getSelectedRow(), 2);
            Short idGrado=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 3);
            Short idCiclo=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 4);
            Short idSeccion=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 5);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);//modificar el constructor del GradoJpaController
            List<Gradoseccionciclo> gscs = gsc.findGradoseccioncicloEntities();
                for(Gradoseccionciclo i: gscs)
                {
                    if(i.getIdGradoSeccionCiclo()==idClase)
                    {
                        jTabbedPane5.setSelectedIndex(2);
                        jLabel51.setText(idClase.toString());
                        SpinnerNumberModel nuevo= new SpinnerNumberModel();
                        nuevo.setValue(capacidad);
                        jSpinner4.setModel(nuevo);
                        aulaClaseEditar.setText(aula);
                        jLabel57.setText(idGrado.toString());
                        jLabel58.setText(idSeccion.toString());
                        jLabel59.setText(idCiclo.toString());
                        aulaClaseEditar.setFocusable(true);
                        editarClase.setVisible(false);
                        eliminarClase.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarClase.setVisible(false);
            eliminarClase.setVisible(false);
        }
    }//GEN-LAST:event_editarClaseMouseClicked

    private void eliminarClaseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eliminarClaseMouseClicked
        // TODO add your handling code here:
        
        int op=JOptionPane.showConfirmDialog(null,"¿Confirma ingresar a Eliminar el campo seleccionado?","Editar Campo", JOptionPane.YES_NO_OPTION);
        if(op==0)
        {
             Component temp=this.getEliminarPanelClase();
            jTabbedPane5.add("Eliminar Clase",temp);
            Short idClase=(Short) jTable4.getValueAt(jTable4.getSelectedRow(), 0);
            Short capacidad=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 1);
            String aula=(String)jTable4.getValueAt(jTable4.getSelectedRow(), 2);
            Short idGrado=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 3);
            Short idCiclo=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 4);
            Short idSeccion=(Short)jTable4.getValueAt(jTable4.getSelectedRow(), 5);

            conexion cnx=conexion.ObtenerInstancia();
            EntityManagerFactory emf=cnx.ObtenerEMF();
            GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);//modificar el constructor del GradoJpaController
            List<Gradoseccionciclo> gscs = gsc.findGradoseccioncicloEntities();
                for(Gradoseccionciclo i: gscs)
                {
                    if(i.getIdGradoSeccionCiclo()==idClase)
                    {
                        jTabbedPane5.setSelectedIndex(2);
                        jLabel61.setText(idClase.toString());
                        jLabel70.setText(capacidad.toString());
                        jLabel71.setText(aula);
                        jLabel65.setText(idGrado.toString());
                        jLabel67.setText(idCiclo.toString());
                        jLabel68.setText(idSeccion.toString());
                        editarClase.setVisible(false);
                        eliminarClase.setVisible(false);
                        break;
                    }
                }
        }
        else
        {
            editarClase.setVisible(false);
            eliminarClase.setVisible(false);
        }
    }//GEN-LAST:event_eliminarClaseMouseClicked

    private void aceptarCicloCreadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarCicloCreadoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aceptarCicloCreadoActionPerformed

    private void cancelarClaseCreadaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarClaseCreadaMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_cancelarClaseCreadaMouseClicked

    private void aceptarClaseCreadaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarClaseCreadaMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);
        GradoJpaController grado=new GradoJpaController(emf);
        CicloJpaController ciclo=new CicloJpaController(emf);
        SeccionJpaController seccion=new SeccionJpaController(emf);
        Short idGrado=1,idSeccion=0,idCiclo=0;
        Grado tGrado=new Grado();
        Seccion tSeccion=new Seccion();
        Ciclo tCiclo=new Ciclo();
        try
        {
            Gradoseccionciclo nuevoGsc= new Gradoseccionciclo();
            nuevoGsc.setIdGradoSeccionCiclo(null);
            nuevoGsc.setCapacidad(Short.valueOf(jSpinner3.getValue().toString()));
            nuevoGsc.setAula(aulaClase.getText());
            List<Grado> grados = grado.findGradoEntities();
            for(Grado h: grados)
            {
                if(grado.findGrado(h.getIdGrado()).getIdGrado()==Short.valueOf(String.valueOf(comboIdGrado.getSelectedItem())))
                   nuevoGsc.setGrado(grado.findGrado(h.getIdGrado()));
                    
            }
            List<Ciclo> ciclos = ciclo.findCicloEntities();
            for(Ciclo i: ciclos)
            {
                if(ciclo.findCiclo(i.getIdCiclo()).getIdCiclo()==Short.valueOf(String.valueOf(comboIdCiclo.getSelectedItem())))
                    nuevoGsc.setCiclo(ciclo.findCiclo(i.getIdCiclo()));
            }
            List<Seccion> secciones = seccion.findSeccionEntities();
            System.out.println(String.valueOf(comboIdSeccion.getSelectedIndex()));
            for(Seccion j: secciones)
            {
                if(seccion.findSeccion(j.getIdSeccion()).getIdSeccion()==Short.valueOf(String.valueOf(comboIdSeccion.getSelectedItem())))
                    nuevoGsc.setSeccion(seccion.findSeccion(j.getIdSeccion()));
            }
            
            gsc.create(nuevoGsc);    
            JOptionPane.showMessageDialog(null, "La Clase ha sido creada Exitosamente", "Información", JOptionPane.INFORMATION_MESSAGE);               
            this.cargarTablaClases();
            aulaClase.setText("");

        }
        catch(Exception e)
                {
                 JOptionPane.showMessageDialog(null, "No se ha podido crear la Clase: "+e, "Error", JOptionPane.ERROR_MESSAGE);   
                }
    }//GEN-LAST:event_aceptarClaseCreadaMouseClicked

    private void aceptarClaseCreadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarClaseCreadaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aceptarClaseCreadaActionPerformed

    private void jTabbedPane5MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPane5MousePressed
        // TODO add your handling code here:
        this.llenarComboCiclos();
        this.llenarComboGrados();
        this.llenarComboSecciones();
    }//GEN-LAST:event_jTabbedPane5MousePressed

    private void cancelarClaseCreada1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarClaseCreada1MouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane5.removeTabAt(2);
            jTabbedPane5.setSelectedIndex(0);
        }
    }//GEN-LAST:event_cancelarClaseCreada1MouseClicked

    private void aceptarClaseCreada1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarClaseCreada1MouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);//modificar el constructor del GradoJpaController
        List<Gradoseccionciclo> gscs = gsc.findGradoseccioncicloEntities();
            for(Gradoseccionciclo i: gscs)
            {
                if(i.getIdGradoSeccionCiclo()==Short.valueOf(jLabel51.getText().trim()))
                { 
                    try 
                    {
                        i.setIdGradoSeccionCiclo(Short.valueOf(jLabel51.getText().trim()));
                        i.setCapacidad(Short.valueOf(jSpinner3.getValue().toString()));
                        i.setAula(aulaClaseEditar.getText());
                        gsc.edit(i);
                        JOptionPane.showMessageDialog(null,"La Clase ha sido correctamente editada","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane5.removeTabAt(2);
                        jTabbedPane5.setSelectedIndex(0);
                        this.cargarTablaClases();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"La Clase no pudo ser editada: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_aceptarClaseCreada1MouseClicked

    private void aceptarClaseCreada1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarClaseCreada1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aceptarClaseCreada1ActionPerformed

    private void cancelarClaseCreada2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cancelarClaseCreada2MouseClicked
        // TODO add your handling code here:
        int i=JOptionPane.showConfirmDialog(null,"¿Realmente desea salir del formulario sin guardar los cambios?","Cancelar Acción", JOptionPane.YES_NO_OPTION);
        if(i==0)
        {
            jTabbedPane5.removeTabAt(2);
            jTabbedPane5.setSelectedIndex(0);
        }
        
    }//GEN-LAST:event_cancelarClaseCreada2MouseClicked

    private void aceptarClaseEliminadaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aceptarClaseEliminadaMouseClicked
        // TODO add your handling code here:
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoseccioncicloJpaController gsc=new GradoseccioncicloJpaController(emf);//modificar el constructor del GradoJpaController
        List<Gradoseccionciclo> gscs = gsc.findGradoseccioncicloEntities();
            for(Gradoseccionciclo i: gscs)
            {
                if(i.getIdGradoSeccionCiclo()==Short.valueOf(jLabel61.getText().trim()))
                { 
                    try 
                    {
                        gsc.destroy(Short.valueOf(jLabel61.getText().trim()));
                        JOptionPane.showMessageDialog(null,"La Clase ha sido correctamente Eliminada","Información",JOptionPane.INFORMATION_MESSAGE);
                        jTabbedPane5.removeTabAt(2);
                        jTabbedPane5.setSelectedIndex(0);
                        this.cargarTablaClases();
                        break;
                    } 
                    catch (Exception ex) 
                    {
                        JOptionPane.showMessageDialog(null,"La Clase no pudo ser Eliminada: " + ex,"Error",JOptionPane.ERROR_MESSAGE);
                    } 
                    
                }
            }
    }//GEN-LAST:event_aceptarClaseEliminadaMouseClicked

    private void aceptarClaseEliminadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarClaseEliminadaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_aceptarClaseEliminadaActionPerformed

    private void buscarGradoMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buscarGradoMouseEntered
        // TODO add your handling code here:
    }//GEN-LAST:event_buscarGradoMouseEntered

    private void verGradoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verGradoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_verGradoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        conexion cnx=conexion.ObtenerInstancia();
        EntityManagerFactory emf=cnx.ObtenerEMF();
        GradoJpaController grado=new GradoJpaController(emf);//modificar el constructor del GradoJpaController
        EntityManager em=emf.createEntityManager();
        List<Grado> grados = grado.findGradoEntities();
         //   for(Grado i: grados)
          //  {
         //       System.out.print(i.getNombre());
         //   }
        
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(bIngresoGradoCicloSeccion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(bIngresoGradoCicloSeccion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(bIngresoGradoCicloSeccion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(bIngresoGradoCicloSeccion.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        
        /*
         * Create and display the dialog
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                bIngresoGradoCicloSeccion dialog = new bIngresoGradoCicloSeccion(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton aceptarCicloCreado;
    private javax.swing.JButton aceptarClaseCreada;
    private javax.swing.JButton aceptarClaseCreada1;
    private javax.swing.JButton aceptarClaseEliminada;
    private javax.swing.JButton aceptarCrearSeccion;
    private javax.swing.JButton aceptarEditarCiclo;
    private javax.swing.JButton aceptarEditarGrado;
    private javax.swing.JButton aceptarEliminarCiclo;
    private javax.swing.JButton aceptarGradoCreado;
    private javax.swing.JTextField aulaClase;
    private javax.swing.JTextField aulaClaseEditar;
    private javax.swing.JTextField añoCicloCreado;
    private javax.swing.JButton buscarCiclo;
    private javax.swing.JButton buscarClase;
    private javax.swing.JButton buscarGrado;
    private javax.swing.JButton buscarSeccion;
    private javax.swing.JButton cancelarCicloCreado;
    private javax.swing.JButton cancelarClaseCreada;
    private javax.swing.JButton cancelarClaseCreada1;
    private javax.swing.JButton cancelarClaseCreada2;
    private javax.swing.JButton cancelarCrearSeccion;
    private javax.swing.JButton cancelarEditarCiclo;
    private javax.swing.JButton cancelarEditarGrado;
    private javax.swing.JButton cancelarEliminarCiclo;
    private javax.swing.JButton cancelarGradoCreado;
    private javax.swing.JComboBox comboIdCiclo;
    private javax.swing.JComboBox comboIdGrado;
    private javax.swing.JComboBox comboIdSeccion;
    private javax.swing.JButton editarCiclo;
    private javax.swing.JButton editarClase;
    private javax.swing.JButton editarGrado;
    private javax.swing.JButton editarSeccion;
    private javax.swing.JButton eliminarCiclo;
    private javax.swing.JButton eliminarClase;
    private javax.swing.JButton eliminarGrado;
    private javax.swing.JButton eliminarGradoAceptar;
    private javax.swing.JButton eliminarSeccion;
    private javax.swing.JTextField filtroCiclo;
    private javax.swing.JTextField filtroClase;
    private javax.swing.JTextField filtroGrado;
    private javax.swing.JTextField filtroSeccion;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel66;
    private javax.swing.JLabel jLabel67;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel72;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JSpinner jSpinner2;
    private javax.swing.JSpinner jSpinner3;
    private javax.swing.JSpinner jSpinner4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JTabbedPane jTabbedPane4;
    private javax.swing.JTabbedPane jTabbedPane5;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTable4;
    private com.l2fprod.common.swing.JTaskPane jTaskPane1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField nombreGradoIngresado;
    private javax.swing.JTextField notaAprobacionCicloCreado;
    private javax.swing.JButton verCiclos;
    private javax.swing.JButton verClases;
    private javax.swing.JButton verGrado;
    private javax.swing.JButton verSecciones;
    // End of variables declaration//GEN-END:variables
}
